Skip to content

Check for PQERRORS_SQLSTATE in PGVerbosity enum #14519

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 9, 2024

Conversation

petk
Copy link
Member

@petk petk commented Jun 9, 2024

The PG_VERSION_NUM is not available in intended public PostgreSQL headers unless the pg_config.h is included or the PostgreSQL server development headers are installed separately. This instead resorts to checking for the PGVerbosity enum value. The PQERRORS_SQLSTATE was added to PostgreSQL 12.0.

The PG_VERSION_NUM is not available in intended public PostgreSQL
headers unless the pg_config.h is included or the PostgreSQL server
development headers are installed separately. This instead resorts to
checking for the PGVerbosity enum value. The PQERRORS_SQLSTATE was added
to PostgreSQL 12.0.
Copy link
Member

@devnexen devnexen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

true you needed the server bits, I forgot.

@petk
Copy link
Member Author

petk commented Jun 9, 2024

And on Windows, it is currently at version 11.4, so it's not defined there yet. I think this will work fine. Otherwise, it's quite problematic that to find out if some enum value is available entire compile test program needs to be done. There doesn't seem to be any AC_CHECK_ENUM macros :D

@petk petk merged commit 65ff511 into php:master Jun 9, 2024
11 checks passed
@petk petk deleted the patch-PG_VERSION_NUM branch June 9, 2024 09:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants